package com.eastfair.venuebooking.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.core.base.R;
import com.eastfair.venueservice.dto.ServiceLossDTO;
import com.eastfair.venueservice.vo.ServiceLossVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * 报损记录 feign.
 *
 * @author dqq
 * @date 2022 /9/22
 */
@FeignClient(value = "venue-services-manage/serviceLoss")
public interface ServiceLossFeign {

    /**
     * 分页查询报损记录VO列表.
     *
     * @param pageParams the page params
     * @return the r
     */
    @PostMapping("/query/serviceLoss")
    R<Page<ServiceLossVO>> queryServiceLoss(@RequestBody PageParams<ServiceLossDTO> pageParams);

    /**
     * 返修入库.
     *
     * @param serviceLossDTO the service loss dto
     * @return the r
     */
    @PostMapping("/repair/inInventory")
    R<Boolean> repairInInventory(@RequestBody ServiceLossDTO serviceLossDTO);

    /**
     * 报损类型统计.
     *
     * @param serviceLossDTO the service loss dto
     * @return the r
     */
    @PostMapping("/count/lossNum")
    R<Map<String, Object>> countLossNum(@RequestBody ServiceLossDTO serviceLossDTO);
}